package gui_TJCPS;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.SwingConstants;



/**
 * @author fabio abrantes d
 */
public class PanelRss extends JPanel {
	
	public JLabel labeltituloDaNoticia;
	private JScrollPane scrollPaneDaNoticias;
	
	public JTextPane textPaneNoticias;
	
	public PanelRss() {
		inicializaComponentes();
	}

	private void inicializaComponentes() {
		
		// aqui cria os componentes
		
		labeltituloDaNoticia = new JLabel();
		scrollPaneDaNoticias = new JScrollPane();
		//textAreaNoticias = new JTextArea();
		textPaneNoticias = new JTextPane();
		
		//======== aqui atualiza o PanelRss ========
		this.setBackground(  Color.BLACK);
		this.setMinimumSize(new Dimension(250, 300));
		this.setMaximumSize(new Dimension(250, 300));
		this.setPreferredSize(new Dimension(250, 300));
		
		// -----aqui atualiza o scrollPaneDaNoticias -----
		
		
		
		
		
		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

		//---- labeltituloDaNoticia ----
		
		this.labeltituloDaNoticia.setText("5456465416");
		this.labeltituloDaNoticia.setFont(new Font("Candara", 0, 30));
		
		this.labeltituloDaNoticia.setForeground(Color.WHITE);
		this.labeltituloDaNoticia.setHorizontalAlignment(SwingConstants.LEFT);
		this.labeltituloDaNoticia.setHorizontalTextPosition(SwingConstants.CENTER);
		
		this.labeltituloDaNoticia.setPreferredSize(new Dimension(350, 40));
		
		this.add(labeltituloDaNoticia);

		//======== scrollPaneDaNoticias ========
		{
			//---- textPaneNoticias ----
			
			this.textPaneNoticias.setBackground(Color.BLACK);
			this.textPaneNoticias.setForeground(Color.WHITE);
			this.textPaneNoticias.setFont(new Font("Candara", 0, 20));
			this.textPaneNoticias.setPreferredSize(new Dimension(200, 50));
			this.textPaneNoticias.setEditable(false);
			this.textPaneNoticias.setText("");
			
			this.scrollPaneDaNoticias.setViewportView(textPaneNoticias);
			this.scrollPaneDaNoticias.getHorizontalScrollBar().setPreferredSize(new Dimension(30, 30));
			
			
		}
		this.add(scrollPaneDaNoticias);
		
	}

	
	
	
}
